<div class="card mb-4">
  <div class="card-header">
    <h5 class="card-title">
      <%= Spree.t(:stores) %>
    </h5>
  </div>
  <div class="card-body">
    <div class="form-group">
      <% if can? :modify, Spree::StoreProduct %>
        <p class="form-text"><%= Spree.t('admin.products.stores.choose_stores') %>.</p>

        <%= f.collection_check_boxes :store_ids, available_stores, :id, :name do |b| %>
          <div class="custom-control custom-checkbox mb-1">
            <%= b.check_box(class: 'custom-control-input') %>
            <%= b.label(class: 'custom-control-label') %>
          </div>
        <% end %>
      <% elsif @product.stores.any? %>
        <ul class="text_list">
          <% @product.stores.pluck(:name).each do |store_name| %>
            <li><%= store_name %></li>
          <% end %>
        </ul>
      <% end %>
    </div>
  </div>
</div>